package jsyf.oa.entity.contract;

import com.alibaba.fastjson.JSONObject;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

import java.math.BigDecimal;

/**
 * Created by Administrator on 2018/6/20 0020.
 */
@Entity
@Table(name = "t_con_sales", schema = "oa", catalog = "")
public class ContractSalesEntity extends BaseEntity {

    private String mainId = "";
    private String otherGifts = "";//其他赠送
    private String payMonth = "";//支付月数
    private String payTimes = "";//支付次数
    private String stageTerm = "";//分期期限
    private String payTimesFqFirst = "";//分期首付金额支付次数
    private String stageTermFqFirst = "";//分期首付金额分期期限
    private String downPayment = "";//首付比例
    private String loanRation = "";//贷款比例
    private String loanTerm = "";//贷款期限
    private String accessoryGift = "";//配件赠送
    private String priceOffer = "";//价格优惠说明
    private String rzdbTotalPricedx = "";//融资打包总价金额
    private Integer dealNo = 1;//数量
    private BigDecimal unitPrice = new BigDecimal("0.00");//单价
    private BigDecimal totalPrice = new BigDecimal("0.00");//总价
    private BigDecimal firstPayment = new BigDecimal("0.00");//首付金额
    private BigDecimal loanAmount = new BigDecimal("0.00");//贷款金额
    private BigDecimal bond = new BigDecimal("0.00");//保证金
    private BigDecimal insurancePremium = new BigDecimal("0.00");//保险费
    private BigDecimal serviceCharge = new BigDecimal("0.00");//手续费
    private BigDecimal gpsCharge = new BigDecimal("0.00");//GPS费
    private BigDecimal securityCharge = new BigDecimal("0.00");//担保费
    private BigDecimal otherCharge = new BigDecimal("0.00");//其他费用
    private BigDecimal total = new BigDecimal("0.00");// 合计
    private BigDecimal monthlyRepayment = new BigDecimal("0.00");//融资打包月还款
    private BigDecimal financingAmount = new BigDecimal("0.00");//融资台账的融资金额
    private Integer logFlag = 0;
    private BigDecimal noTaxAmount = new BigDecimal("0.00");//不含税金额
    private BigDecimal taxAmount = new BigDecimal("0.00");//增值税税额

    public BigDecimal getNoTaxAmount() {
        return noTaxAmount;
    }

    public void setNoTaxAmount(BigDecimal noTaxAmount) {
        this.noTaxAmount = noTaxAmount;
    }

    public BigDecimal getTaxAmount() {
        return taxAmount;
    }

    public void setTaxAmount(BigDecimal taxAmount) {
        this.taxAmount = taxAmount;
    }

    public Integer getLogFlag() {
        return logFlag;
    }

    public void setLogFlag(Integer logFlag) {
        this.logFlag = logFlag;
    }
    public String getPayTimesFqFirst() {
        return payTimesFqFirst;
    }

    public void setPayTimesFqFirst(String payTimesFqFirst) {
        this.payTimesFqFirst = payTimesFqFirst;
    }

    public String getStageTermFqFirst() {
        return stageTermFqFirst;
    }

    public void setStageTermFqFirst(String stageTermFqFirst) {
        this.stageTermFqFirst = stageTermFqFirst;
    }

    public BigDecimal getFinancingAmount() {
        return financingAmount;
    }

    public void setFinancingAmount(BigDecimal financingAmount) {
        this.financingAmount = financingAmount;
    }

    public BigDecimal getMonthlyRepayment() {
        return monthlyRepayment;
    }

    public void setMonthlyRepayment(BigDecimal monthlyRepayment) {
        this.monthlyRepayment = monthlyRepayment;
    }

    public String getRzdbTotalPricedx() {
        return rzdbTotalPricedx;
    }

    public void setRzdbTotalPricedx(String rzdbTotalPricedx) {
        this.rzdbTotalPricedx = rzdbTotalPricedx;
    }

    public String getAccessoryGift() {
        return accessoryGift;
    }

    public void setAccessoryGift(String accessoryGift) {
        this.accessoryGift = accessoryGift;
    }

    public String getPriceOffer() {
        return priceOffer;
    }

    public void setPriceOffer(String priceOffer) {
        this.priceOffer = priceOffer;
    }

    public String getMainId() {
        return mainId;
    }

    public void setMainId(String mainId) {
        this.mainId = mainId;
    }

    public Integer getDealNo() {
        return dealNo;
    }

    public void setDealNo(Integer dealNo) {
        this.dealNo = dealNo;
    }

    public String getOtherGifts() {
        return otherGifts;
    }

    public void setOtherGifts(String otherGifts) {
        this.otherGifts = otherGifts;
    }

    public String getPayMonth() {
        return payMonth;
    }

    public void setPayMonth(String payMonth) {
        this.payMonth = payMonth;
    }

    public String getPayTimes() {
        return payTimes;
    }

    public void setPayTimes(String payTimes) {
        this.payTimes = payTimes;
    }

    public String getStageTerm() {
        return stageTerm;
    }

    public void setStageTerm(String stageTerm) {
        this.stageTerm = stageTerm;
    }

    public String getDownPayment() {
        return downPayment;
    }

    public void setDownPayment(String downPayment) {
        this.downPayment = downPayment;
    }

    public String getLoanRation() {
        return loanRation;
    }

    public void setLoanRation(String loanRation) {
        this.loanRation = loanRation;
    }

    public String getLoanTerm() {
        return loanTerm;
    }

    public void setLoanTerm(String loanTerm) {
        this.loanTerm = loanTerm;
    }

    public BigDecimal getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(BigDecimal unitPrice) {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getFirstPayment() {
        return firstPayment;
    }

    public void setFirstPayment(BigDecimal firstPayment) {
        this.firstPayment = firstPayment;
    }

    public BigDecimal getLoanAmount() {
        return loanAmount;
    }

    public void setLoanAmount(BigDecimal loanAmount) {
        this.loanAmount = loanAmount;
    }

    public BigDecimal getBond() {
        return bond;
    }

    public void setBond(BigDecimal bond) {
        this.bond = bond;
    }

    public BigDecimal getInsurancePremium() {
        return insurancePremium;
    }

    public void setInsurancePremium(BigDecimal insurancePremium) {
        this.insurancePremium = insurancePremium;
    }

    public BigDecimal getServiceCharge() {
        return serviceCharge;
    }

    public void setServiceCharge(BigDecimal serviceCharge) {
        this.serviceCharge = serviceCharge;
    }

    public BigDecimal getGpsCharge() {
        return gpsCharge;
    }

    public void setGpsCharge(BigDecimal gpsCharge) {
        this.gpsCharge = gpsCharge;
    }

    public BigDecimal getSecurityCharge() {
        return securityCharge;
    }

    public void setSecurityCharge(BigDecimal securityCharge) {
        this.securityCharge = securityCharge;
    }

    public BigDecimal getOtherCharge() {
        return otherCharge;
    }

    public void setOtherCharge(BigDecimal otherCharge) {
        this.otherCharge = otherCharge;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("MAIN_ID", getMainId());
        obj.put("DEAL_NO", getDealNo());
        obj.put("UNIT_PRICE", getUnitPrice());
        obj.put("TOTAL_PRICE", getTotalPrice());
        obj.put("DOWN_PAYMENT", getDownPayment());
        obj.put("FIRST_PAYMENT", getFirstPayment());
        obj.put("LOAN_RATIO", getLoanRation());
        obj.put("LOAN_AMOUNT", getLoanAmount());
        obj.put("LOAN_TERM", getLoanTerm());
        obj.put("STAGE_TERM", getStageTerm());
        obj.put("BOND", getBond());
        obj.put("INSURANCE_PREMIUM", getInsurancePremium());
        obj.put("SERVICE_CHARGE", getServiceCharge());
        obj.put("GPS_CHARGE", getGpsCharge());
        obj.put("SECURITY_CHARGE", getSecurityCharge());
        obj.put("OTHER_CHARGE", getOtherCharge());
        obj.put("OTHER_GIFTS", getOtherGifts());
        obj.put("TOTAL", getTotal());
        obj.put("PAY_MONTH", getPayMonth());
        obj.put("PAY_TIMES", getPayTimes());
        obj.put("PRICE_OFFER", getPriceOffer());
        obj.put("ACCESSORY_GIFT", getAccessoryGift());
        obj.put("RZDB_TOTAL_PRICEDX", getRzdbTotalPricedx());
        obj.put("MONTHLY_REPAYMENT", getMonthlyRepayment());
        obj.put("FINANCING_AMOUNT", getFinancingAmount());
        obj.put("PAY_TIMES_FQ_FIRST", getPayTimesFqFirst());
        obj.put("STAGE_TERM_FQ_FIRST", getStageTermFqFirst());
        obj.put("UPDATE_USER_ID", getUpdateUserId());
        obj.put("UPDATE_TIME", getUpdateTime());
        obj.put("NO_TAX_AMOUNT", getNoTaxAmount());
        obj.put("TAX_AMOUNT", getTaxAmount());
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_con_sales";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("MAIN_ID", "mainId");
        obj.put("DEAL_NO", "dealNo");
        obj.put("UNIT_PRICE", "unitPrice");
        obj.put("TOTAL_PRICE", "totalPrice");
        obj.put("DOWN_PAYMENT", "downPayment");
        obj.put("FIRST_PAYMENT", "firstPayment");
        obj.put("LOAN_RATIO", "loanRation");
        obj.put("LOAN_AMOUNT", "loanAmount");
        obj.put("LOAN_TERM", "loanTerm");
        obj.put("STAGE_TERM", "stageTerm");
        obj.put("BOND", "bond");
        obj.put("INSURANCE_PREMIUM", "insurancePremium");
        obj.put("SERVICE_CHARGE", "serviceCharge");
        obj.put("GPS_CHARGE", "gpsCharge");
        obj.put("SECURITY_CHARGE", "securityCharge");
        obj.put("OTHER_CHARGE", "otherCharge");
        obj.put("OTHER_GIFTS", "otherGifts");
        obj.put("TOTAL", "total");
        obj.put("PAY_MONTH", "payMonth");
        obj.put("PAY_TIMES", "payTimes");
        obj.put("PRICE_OFFER", "priceOffer");
        obj.put("ACCESSORY_GIFT", "accessoryGift");
        obj.put("RZDB_TOTAL_PRICEDX", "rzdbTotalPricedx");
        obj.put("MONTHLY_REPAYMENT", "monthlyRepayment");
        obj.put("FINANCING_AMOUNT", "financingAmount");
        obj.put("PAY_TIMES_FQ_FIRST", "payTimesFqFirst");
        obj.put("STAGE_TERM_FQ_FIRST", "stageTermFqFirst");
        obj.put("UPDATE_USER_ID", "updateUserId");
        obj.put("UPDATE_TIME", "updateTime");
        obj.put("NO_TAX_AMOUNT", "noTaxAmount");
        obj.put("TAX_AMOUNT", "taxAmount");
        return obj;
    }
}

